package com.song.study.spring.Entity;

import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @Author ZhangGuisong
 * @Date 2021/4/24-19:48
 */
public class MyImportDefinitionRegistrar implements ImportBeanDefinitionRegistrar {

    public  void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
       RootBeanDefinition rootBeanDefinition=new RootBeanDefinition(Lion.class);
        registry.registerBeanDefinition("lion",rootBeanDefinition);
    }
}
